import java.util.Scanner;

public class protice11 {
    public static void main(String[] args) {
        /**
         * 用户输入任意一个整数，求各位数字之和
         */
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个整数：");
        double num = sc.nextDouble();
        long sum = 0;
        while(num>0){
            sum += num%10;
            num = num /10;
        }
        System.out.println(sum);
    }
}
